package com.zhangshuo.patternDesign.resrponsibility;

/**
 * Created by shuo.zhang on 2017-11-03.
 */
public class CommonUtils {

    /**
     * 两点间的距离是否小于指定距离

     * @param compare
     * @return
     */
    public static boolean instanceLessThan(int x1,int y1,int x2,int y2,int compare){
        return Math.ceil(Math.sqrt(Math.pow((x1-x2),2)+Math.pow((y1-y2),2))) <= compare;
    }
}
